<!--# layout("/common/layout.html",{"jsBase":"/js/contract/contractInfo/"}){ -->

<form class="layui-form layui-form-pane" id="addForm"  lay-filter="editform">
    <input type="hidden" name="contractId" id="contractId">
   <br>
    <div class="layui-row">
        <div class="layui-form-item">
            <div class="layui-inline">
            <label class="layui-form-label">合同号</label>
				<div class="layui-input-inline">
                    <input type="text" name="invoiceNo" id="invoiceNo" autocomplete="off" maxlength="50" class="layui-input" disabled >
				</div>
            </div>
            <div class="layui-inline">
            <label class="layui-form-label">家长姓名</label>
				<div class="layui-input-inline">
                    <input type="text" name="customerName" id="customerName" autocomplete="off" maxlength="50" class="layui-input" lay-verify="required" readonly>
				</div>
            </div>
            <div class="layui-inline">
            <label class="layui-form-label">家长手机号</label>
				<div class="layui-input-inline">
                    <input type="text" name="customerPhone" id="customerPhone" autocomplete="off" maxlength="50" class="layui-input" lay-verify="required|phone" readonly>
				</div>
            </div>
        </div>
    </div>

    <div class="layui-row">
        <div class="layui-form-item">
            <div class="layui-inline">
            <label class="layui-form-label">家长身份证</label>
				<div class="layui-input-inline">
                    <input type="text" name="customerIdcard" id="customerIdcard" autocomplete="off" maxlength="50" class="layui-input" lay-verify="required|identity" readonly>
				</div>
            </div>
            <div class="layui-inline">
            <label class="layui-form-label">学生姓名</label>
				<div class="layui-input-inline">
                    <input type="text" name="studentName" id="studentName" autocomplete="off" maxlength="50" class="layui-input" lay-verify="required" readonly>
				</div>
            </div>
            <div class="layui-inline">
            <label class="layui-form-label">学生手机号</label>
				<div class="layui-input-inline">
                    <input type="text" name="studentPhone" id="studentPhone" autocomplete="off" maxlength="50" class="layui-input" lay-verify="required|phone" readonly>
				</div>
            </div>
        </div>
    </div>

    <div class="layui-row">
        <div class="layui-form-item">
            <div class="layui-inline">
            <label class="layui-form-label">高考年份</label>
				<div class="layui-input-inline">
                    <input type="text" name="graduateYear" id="graduateYear" autocomplete="off" maxlength="50" class="layui-input" lay-verify="required" readonly>
				</div>
            </div>
            <div class="layui-inline">
            <label class="layui-form-label">签单老师</label>
				<div class="layui-input-inline">
                    <layui:simpleDataSelect name="seller" value="" data="${customerInfoList}"
                                            attrId="customerId" attrName="customerName" layFilter="customerFilter" id="customer_author" laySearch="true" />
				</div>
            </div>
            <div class="layui-inline">
            <label class="layui-form-label">服务老师</label>
				<div class="layui-input-inline">
                    <layui:simpleDataSelect name="servant" value="" data="${customerInfoList}"
                                            attrId="customerId" attrName="customerName" layFilter="customerFilter" id="customer_author" laySearch="true" />
				</div>
            </div>
        </div>
    </div>

    <div class="layui-row">
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">服务团队</label>
                <div class="layui-input-block" style="width:512px" id="contractMember">
                </div>
            </div>
        </div>
    </div>
    <!--
    <div class="layui-row">
        <div class="layui-form-item">
            <div class="layui-inline">
            <label class="layui-form-label">学生信息</label>
				<div class="layui-input-inline">
                    <input type="text" name="schoolExt" id="schoolExt" autocomplete="off" maxlength="50" class="layui-input" >
				</div>
            </div>
            <div class="layui-inline">
            <label class="layui-form-label">退费约定</label>
				<div class="layui-input-inline">
                    <input type="text" name="refundExt" id="refundExt" autocomplete="off" maxlength="50" class="layui-input" >
				</div>
            </div>
            <div class="layui-inline">
            <label class="layui-form-label">发票需求</label>
				<div class="layui-input-inline">
                    <input type="text" name="openTicket" id="openTicket" autocomplete="off" maxlength="50" class="layui-input" >
				</div>
            </div>
        </div>
    </div>
    -->

    <div class="layui-row">
        <div class="layui-form-item">
            <div class="layui-inline">
            <label class="layui-form-label">签署日期</label>
				<div class="layui-input-inline">
                    <input type="text" name="optDate" id="optDate" autocomplete="off" maxlength="50" class="layui-input" readonly>
				</div>
            </div>
            <div class="layui-inline">
            <label class="layui-form-label">合同总金额</label>
				<div class="layui-input-inline">
                    <input type="text" name="contractAmt" id="contractAmt" autocomplete="off" maxlength="50" class="layui-input" readonly>
				</div>
            </div>
            <div class="layui-inline">
            <label class="layui-form-label">支付时间</label>
				<div class="layui-input-inline">
                    <input type="text" name="payTime" id="payTime" autocomplete="off" maxlength="50" class="layui-input" readonly>
				</div>
            </div>
        </div>
    </div>

    <div class="layui-row">
        <div class="layui-form-item">
            <div class="layui-inline">
            <label class="layui-form-label">合同路径</label>
				<div class="layui-input-inline">
                    <input type="text" name="urlPdf" id="urlPdf" autocomplete="off" maxlength="50" class="layui-input" readonly="true" onclick="window.open('http://${contractInfo.urlPdf}','_blank')" aria-readonly="true">
				</div>
            </div>
            <div class="layui-inline">
            <label class="layui-form-label">合同状态</label>
				<div class="layui-input-inline">
                    <select name="htStatus" lay-verify="" disabled>
                        <option value="">请选择</option>
                        <option value="0">新建</option>
                        <option value="1">已审核</option>
                        <option value="2">已签</option>
                        <option value="3">作废</option>
                    </select>
				</div>
            </div>
            <div class="layui-inline">
            <label class="layui-form-label">付款状态</label>
				<div class="layui-input-inline">
                    <select name="fkStatus" lay-verify="" disabled>
                        <option value="">请选择</option>
                        <option value="0">待付款</option>
                        <option value="1">已付款</option>
                        <option value="2">已确认</option>
                    </select>
				</div>
            </div>
        </div>
    </div>

    <div class="layui-row">
        <div class="layui-form-item">
            <div class="layui-inline">
            <label class="layui-form-label">服务状态</label>
				<div class="layui-input-inline">
                    <select name="fwStatus" lay-verify="" disabled>
                        <option value="">请选择</option>
                        <option value="0">未开启</option>
                        <option value="1">进行中</option>
                        <option value="2">已结束</option>
                    </select>
				</div>
            </div>
            <div class="layui-inline">
            <label class="layui-form-label">退款状态</label>
				<div class="layui-input-inline">
                    <select name="tkStatus" lay-verify="" disabled>
                        <option value="">请选择</option>
                        <option value="0">待申请</option>
                        <option value="1">待审核</option>
                        <option value="2">退款中</option>
                        <option value="3">已退款</option>
                        <option value="4">不退款</option>
                    </select>
				</div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">创单日期</label>
                <div class="layui-input-inline">
                    <input type="text" name="createDate" id="createDate" autocomplete="off" maxlength="50" class="layui-input" disabled>
                </div>
            </div>

            <!--<div class="layui-inline">-->
            <!--<label class="layui-form-label">服务评价</label>-->
				<!--<div class="layui-input-inline">-->
                                <!--<input type="text" name="comment" id="comment" autocomplete="off" maxlength="50" class="layui-input" >-->
				<!--</div>-->
            <!--</div>-->
        </div>
    </div>

    <div class="layui-row">
        <div class="layui-form-item">
            <div class="layui-inline">
            <label class="layui-form-label">服务备注</label>
                <div class="layui-input-block" style="width:512px">
                    <textarea name="remark"  id="remark" placeholder="请服务老师填写考生的省分、文理科、分数、省排名" class="layui-textarea"></textarea>
                </div>
            </div>
        </div>
    </div>
    <layui:submitButtons id="addButton" />
</form>
<!--#} -->
<script>
layui.extend({
    loading: '../../../plugins/layui_extends/loading/loading',
    selectM: '../../../plugins/layui_extends/selectM',
}).define([ 'form', 'laydate', 'table','loading','contractInfoApi','selectM'], function(exports) {
    var form = layui.form;
    var contractInfoApi = layui.contractInfoApi;
    var index = layui.index;
    var selectM = layui.selectM;
    var isNew = true;
    <!--# if(!(isEmpty(contractInfoJson))){  -->
    isNew = false;
    <!--# } -->
    var tagData = ${customerList};

    $("#customer_author").attr("disabled","disabled")
    var view = {
        init:function(){
            Lib.initGenrealForm($("#addForm"),form);

            var tagIns2 = selectM({
                //元素容器【必填】
                elem: '#contractMember'
                //候选数据【必填】
                ,data: tagData
                //默认值
                ,selected: [${selectedMerber!}]
                //最多选中个数，默认5
                ,max : 5
                //input的name 不设置与选择器相同(去#.)
                ,name: 'contractMember'
                //值的分隔符
                ,delimiter: ','
                //候选项数据的键名
                ,field: {idName:'customerId',titleName:'customerName'}
            });

            this.initSubmit();
        },
        initSubmit:function(){
            $("#addButton").click(function(){
                // $("#addButton").hide();
                // $("#addButton-loading").show();
                // $("#addButton-loading").loading();
                form.on('submit(form)', function(){
                    contractInfoApi.saveForm(isNew,$('#addForm'),function(){
                        parent.window.dataReload();
                        Common.info("保存成功");
                        Lib.closeFrame();
                    });
                });
            });

            $("#addButton-cancel").click(function(){
                Lib.closeFrame();
            });
        }

    }
    view.init();
    <!--# if(!(isEmpty(contractInfoJson))){  -->
    var formJson = ${contractInfoJson};
    form.val("editform",formJson);
    <!--# } -->
});
</script>
